package com.yswy.common.utils;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

public class RandomAddressUtils {
    //所有省份
    public static List<String> provinceList() {
        List<String> list = new ArrayList<>();

        list.add("北京市");
        list.add("上海市");
        list.add("天津市");
        list.add("重庆市");
        list.add("黑龙江省");
        list.add("吉林省");
        list.add("辽宁省");
        list.add("内蒙古自治区");
        list.add("河北省");
        list.add("河南省");
        list.add("山东省");
        list.add("山西省");
        list.add("江苏省");
        list.add("安徽省");
        list.add("陕西省");
        list.add("宁夏回族自治区");
        list.add("甘肃省");
        list.add("青海省");
        list.add("湖北省");
        list.add("湖南省");
        list.add("浙江省");
        list.add("江西省");
        list.add("福建省");
        list.add("贵州省");
        list.add("四川省");
        list.add("广东省");
        list.add("广西壮族自治区");
        list.add("云南省");
        list.add("海南省");
        list.add("新疆维吾尔族自治区");
        list.add("西藏自治区");
        list.add("香港");
        list.add("澳门");
        list.add("台湾");
        return list;
    }

    //所有城市
    public static List<String[]> allCity() {
        List<String[]> allCityList = new ArrayList<>();

        allCityList.add(new String[]{"北京"});
        allCityList.add(new String[]{"上海"});
        allCityList.add(new String[]{"天津"});
        allCityList.add(new String[]{"重庆"});

        allCityList.add(new String[]{"哈尔滨", "齐齐哈尔", "牡丹江", "大庆", "伊春", "双鸭山", "鹤岗", "鸡西", "佳木斯", "七台河", "黑河", "绥化", "大兴安岭"});
        allCityList.add(new String[]{"长春", "延边", "吉林", "白山", "白城", "四平", "松原", "辽源", "大安", "通化"});
        allCityList.add(new String[]{"沈阳", "大连", "葫芦岛", "旅顺", "本溪", "抚顺", "铁岭", "辽阳", "营口", "阜新", "朝阳", "锦州", "丹东", "鞍山"});
        allCityList.add(new String[]{"呼和浩特", "呼伦贝尔", "锡林浩特", "包头", "赤峰", "海拉尔", "乌海", "鄂尔多斯", "通辽"});

        allCityList.add(new String[]{"石家庄", "唐山", "张家口", "廊坊", "邢台", "邯郸", "沧州", "衡水", "承德", "保定", "秦皇岛"});
        allCityList.add(new String[]{"郑州", "开封", "洛阳", "平顶山", "焦作", "鹤壁", "新乡", "安阳", "濮阳", "许昌", "漯河", "三门峡", "南阳", "商丘", "信阳", "周口", "驻马店"});
        allCityList.add(new String[]{"济南", "青岛", "淄博", "威海", "曲阜", "临沂", "烟台", "枣庄", "聊城", "济宁", "菏泽", "泰安", "日照", "东营", "德州", "滨州", "莱芜", "潍坊"});
        allCityList.add(new String[]{"太原", "阳泉", "晋城", "晋中", "临汾", "运城", "长治", "朔州", "忻州", "大同", "吕梁"});

        allCityList.add(new String[]{"南京", "苏州", "昆山", "南通", "太仓", "吴县", "徐州", "宜兴", "镇江", "淮安", "常熟", "盐城", "泰州", "无锡", "连云港", "扬州", "常州", "宿迁"});
        allCityList.add(new String[]{"合肥", "巢湖", "蚌埠", "安庆", "六安", "滁州", "马鞍山", "阜阳", "宣城", "铜陵", "淮北", "芜湖", "毫州", "宿州", "淮南", "池州"});
        allCityList.add(new String[]{"西安", "韩城", "安康", "汉中", "宝鸡", "咸阳", "榆林", "渭南", "商洛", "铜川", "延安"});
        allCityList.add(new String[]{"银川", "固原", "中卫", "石嘴山", "吴忠"});

        allCityList.add(new String[]{"兰州", "白银", "庆阳", "酒泉", "天水", "武威", "张掖", "甘南", "临夏", "平凉", "定西", "金昌"});
        allCityList.add(new String[]{"西宁", "海北", "海西", "黄南", "果洛", "玉树", "海东", "海南"});
        allCityList.add(new String[]{"武汉", "宜昌", "黄冈", "恩施", "荆州", "神农架", "十堰", "咸宁", "襄樊", "孝感", "随州", "黄石", "荆门", "鄂州"});
        allCityList.add(new String[]{"长沙", "邵阳", "常德", "郴州", "吉首", "株洲", "娄底", "湘潭", "益阳", "永州", "岳阳", "衡阳", "怀化", "韶山", "张家界"});

        allCityList.add(new String[]{"杭州", "湖州", "金华", "宁波", "丽水", "绍兴", "雁荡山", "衢州", "嘉兴", "台州", "舟山", "温州"});
        allCityList.add(new String[]{"南昌", "萍乡", "九江", "上饶", "抚州", "吉安", "鹰潭", "宜春", "新余", "景德镇", "赣州"});
        allCityList.add(new String[]{"福州", "厦门", "龙岩", "南平", "宁德", "莆田", "泉州", "三明", "漳州"});
        allCityList.add(new String[]{"贵阳", "安顺", "赤水", "遵义", "铜仁", "六盘水", "毕节", "凯里", "都匀"});

        allCityList.add(new String[]{"成都", "泸州", "内江", "凉山", "阿坝", "巴中", "广元", "乐山", "绵阳", "德阳", "攀枝花", "雅安", "宜宾", "自贡", "甘孜州", "达州", "资阳", "广安", "遂宁", "眉山", "南充"});
        allCityList.add(new String[]{"广州", "深圳", "潮州", "韶关", "湛江", "惠州", "清远", "东莞", "江门", "茂名", "肇庆", "汕尾", "河源", "揭阳", "梅州", "中山", "德庆", "阳江", "云浮", "珠海", "汕头", "佛山"});
        allCityList.add(new String[]{"南宁", "桂林", "阳朔", "柳州", "梧州", "玉林", "桂平", "贺州", "钦州", "贵港", "防城港", "百色", "北海", "河池", "来宾", "崇左"});
        allCityList.add(new String[]{"昆明", "保山", "楚雄", "德宏", "红河", "临沧", "怒江", "曲靖", "思茅", "文山", "玉溪", "昭通", "丽江", "大理"});

        allCityList.add(new String[]{"海口", "三亚", "儋州", "琼山", "通什", "文昌"});
        allCityList.add(new String[]{"乌鲁木齐", "阿勒泰", "阿克苏", "昌吉", "哈密", "和田", "喀什", "克拉玛依", "石河子", "塔城", "库尔勒", "吐鲁番", "伊宁"});

        allCityList.add(new String[]{"拉萨","昌都地区","山南地区","阿里地区","那曲地区","林芝地区","日喀则地区"});
        allCityList.add(new String[]{"香港"});
        allCityList.add(new String[]{"澳门"});
        allCityList.add(new String[]{"台湾"});

        return allCityList;
    }


    //所有区（城镇）
    public static List<String[]> allArea() {
        List<String[]> allAreaList = new ArrayList<>();

        allAreaList.add(new String[]{"丰台区","石景山区","海淀区","东城区","西城区","朝阳区"});
        allAreaList.add(new String[]{"杨浦区","虹口山区","闸北区","黄浦区","静安区","卢湾区"});
        allAreaList.add(new String[]{"和平区","河东区","河西区","南开区","河北区","红桥区"});
        allAreaList.add(new String[]{"万州区","涪陵区","渝中区","江北区","沙坪坝区","九龙坡区","南岸区","北碚区","万盛区","双桥区","渝北区","巴南区","黔江区","长寿区","九龙坡区","江津区","合川区","永川区","南川区","綦江县","潼南县","铜梁县","荣昌县","璧山县","梁平县","城口县","丰都县","垫江县","武隆县","忠县","开县","云阳县","奉节县","巫山县","巫溪县"});


        return allAreaList;
    }

    public static List<String> allStreet(){
        List<String> streetList = new ArrayList<>();

        streetList.add("安定门街道");
        streetList.add("建国门街道");
        streetList.add("朝阳门街道");
        streetList.add("东直门街道");
        streetList.add("东华门街道");
        streetList.add("和平里街道");
        streetList.add("北新桥街道");
        streetList.add("交道口街道");
        streetList.add("景山街道");
        streetList.add("东四街道");
        streetList.add("月坛街道");
        streetList.add("德胜街道");
        streetList.add("新街口街道");
        streetList.add("西长安街街道");
        streetList.add("展览路街道");
        streetList.add("什刹海街道");
        streetList.add("金融街街道");
        streetList.add("天坛街道");
        streetList.add("东花市街道");
        streetList.add("前门街道");
        streetList.add("龙潭街道");
        streetList.add("永定门外街道");
        streetList.add("崇文门外街道");
        streetList.add("体育馆路街道");
        streetList.add("广东省");
        streetList.add("大栅栏街道");
        streetList.add("天桥街道");
        streetList.add("椿树街道");
        streetList.add("陶然亭街道");
        streetList.add("广安门内街道");
        streetList.add("牛街街道");
        streetList.add("白纸坊街道");
        streetList.add("广安门外街道");
        streetList.add("朝外街道");
        streetList.add("劲松街道");
        streetList.add("亚运村街道");
        streetList.add("望京街道");
        streetList.add("团结湖街道");
        streetList.add("呼家楼街道");
        streetList.add("三里屯街道");
        streetList.add("香河园街道");
        streetList.add("双井街道");
        streetList.add("建外街道");
        streetList.add("和平街街道");
        streetList.add("垡头街道");
        streetList.add("酒仙桥街道");
        streetList.add("六里屯街道");
        streetList.add("麦子店街道");
        streetList.add("潘家园街道");
        streetList.add("小关街道");
        streetList.add("安贞街道");
        streetList.add("海南省");
        streetList.add("八里庄街道");
        streetList.add("左家庄街道");
        streetList.add("机场街道");
        streetList.add("大屯街道");
        streetList.add("丰台街道");
        streetList.add("西罗园街道");
        streetList.add("方庄地区");
        streetList.add("太平桥街道");
        streetList.add("东铁匠营街道");
        streetList.add("右安门街道");
        streetList.add("长辛店街道");
        streetList.add("新村街道");
        streetList.add("卢沟桥街道");
        streetList.add("云岗街道");
        streetList.add("东高地街道");
        streetList.add("南苑街道");
        streetList.add("大红门街道");
        streetList.add("马家堡街道");
        streetList.add("和义街道");
        streetList.add("宛平地区");
        streetList.add("卢沟桥乡");
        streetList.add("花乡乡");
        streetList.add("南苑乡");
        streetList.add("王佐镇");
        streetList.add("老山街道");
        streetList.add("古城街道");
        streetList.add("金顶街街道");
        streetList.add("北辛安街道");
        streetList.add("鲁谷街道");
        streetList.add("八宝山街道");
        streetList.add("五里坨街道");
        streetList.add("广宁街道");
        streetList.add("苹果园街道");
        streetList.add("八角街道");
        streetList.add("曙光街道");
        streetList.add("温泉镇");
        streetList.add("西北旺镇");
        streetList.add("苏家坨镇");
        streetList.add("万寿路街道");
        streetList.add("羊坊店街道");
        streetList.add("甘家口街道");
        streetList.add("澳门");
        streetList.add("台湾");
        streetList.add("八里庄街道");
        streetList.add("紫竹院街道");
        streetList.add("北下关街道");
        streetList.add("北太平庄街道");
        streetList.add("海淀街道");
        streetList.add("中关村街道");
        streetList.add("学院路街道");
        streetList.add("清河街道");
        streetList.add("青龙桥街道");
        streetList.add("香山街道");
        streetList.add("西三旗街道");
        streetList.add("马连洼街道");
        streetList.add("花园路街道");
        streetList.add("田村路街道");
        streetList.add("上地街道");
        streetList.add("清华园街道");
        streetList.add("燕园街道");
        streetList.add("永定路街道");
        streetList.add("四季青镇");
        streetList.add("上庄镇");
        streetList.add("潭柘寺镇");
        streetList.add("永定镇");
        streetList.add("龙泉镇");
        streetList.add("军庄镇");
        streetList.add("妙峰山镇");
        streetList.add("王平镇");
        streetList.add("雁翅镇");
        streetList.add("斋堂镇");
        streetList.add("清水镇");
        streetList.add("大峪街道");
        streetList.add("城子街道");
        streetList.add("东辛房街道");
        streetList.add("大台街道");
        streetList.add("云南省");
        streetList.add("良乡镇");
        streetList.add("长阳镇");
        streetList.add("城关街道");
        streetList.add("周口店镇");
        streetList.add("琉璃河镇");
        streetList.add("十渡镇");
        streetList.add("大石窝镇");
        streetList.add("燕山地区");
        streetList.add("青龙湖镇");
        streetList.add("阎村镇");
        streetList.add("张坊镇");
        streetList.add("河北镇");
        streetList.add("窦店镇");
        streetList.add("蒲洼乡");
        streetList.add("新镇街道");
        streetList.add("韩村河镇");
        streetList.add("长沟镇");
        streetList.add("南窖乡");
        streetList.add("石楼镇");
        streetList.add("大安山乡");
        streetList.add("拱辰街道");
        streetList.add("西潞街道");

        return streetList;
    }

    //随机获取完整地址
    public static String GetRandomAddress(){
        Random ra =new Random();
        StringBuilder runDomAddress = new StringBuilder();
//        int RandomNum = ra.nextInt(provinceList().size())+0;
//        //省
//        String province  =provinceList().get(RandomNum);
//        runDomAddress.append(province);
//
//        //市
//        String city;
//        int strLength = allCity().get(RandomNum).length;
//        String[] cityStr = allCity().get(RandomNum);
//        city = cityStr[ra.nextInt(strLength)+0];
//        runDomAddress.append(city);
//
//        //区(县)
//        String area;
//        String[] strArea =  allArea().get(ra.nextInt(allArea().size())+0);
//        area = strArea[ra.nextInt(strArea.length)+0];
//        runDomAddress.append(area);

        //街道
        String street = allStreet().get(ra.nextInt(allStreet().size())+0);
        runDomAddress.append(street);

        //门牌号
        String doorNumber = String.valueOf(ra.nextInt(500)+0);
        runDomAddress.append(doorNumber+"号");

        return runDomAddress.toString();
    }

//    public static void main(String[] args) {
//        for(int a = 0;a<5;a++){
//
//            System.out.println("随机生成的地址"+GetRandomAddress());
//        }
//    }
}
